﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace whereIsTheDonutGame
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class Wall : Solid
    {
        public int x, z;
        donutGame game;
        Gate gate;
        List<BoundingBox> boxes;
        public List<Model> models;
        public Model wall;
        public Wall(donutGame game, int x, int z)
        {
            models = new List<Model>();

            this.x = x;
            this.z = z;
            this.game = game;
            LoadContent();
            loadBoundingBoxes();

        }
        public List<BoundingBox> getBoundingBoxes()
        {
            return boxes;
        }

        private void loadBoundingBoxes()
        {
            boxes = new List<BoundingBox>();
            foreach (Model m in models) {
                 boxes.Add(Stuff.CalculateBoundingBox(m, Matrix.CreateTranslation(new Vector3(x, game.terrain.Height[x, z], -z))));
            }
    
        }
        protected void LoadContent()
        {
           models.Add(this.game.Content.Load<Model>("tuerWand1"));
            models.Add(this.game.Content.Load<Model>("tuerWand2"));
            models.Add(this.game.Content.Load<Model>("linkewand"));
            models.Add(this.game.Content.Load<Model>("rechtewand"));
            models.Add(this.game.Content.Load<Model>("rueckwand"));
        }
    }
}
